from django.conf.urls import url
from . import views

urlpatterns = [
    url(r'^register/$', views.UserRegiserView.as_view()),
    url(r'^usernames/(?P<username>\w{5,20})/count/$', views.CheckUsernameView.as_view()),
    # url(r'^/usernames/(?P<username>[a-zA-Z0-9_-]{5,20}) /count/$', views.UserRegiserView.as_view(), name='register')
    #  (?P<username>)是设置名字,可以重定向反解析,根据名字找到子路由
    #     \w 数字字母下划线    \d数字
    #     views.UserRegiserView.as_view() 中的UserRegiserView自定义名,装饰视图函数
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$', views.CheckMobileView.as_view()),
    url(r'^login/$', views.UserLoginView.as_view()),
    url(r'^logout/$', views.UserLogoutView.as_view()),
]
